<?php

defined('MYLITS') ? '' : exit('No direct script access allowed');

/**
 * @version     1.0.0
 * @package     mylits engine
 * @license     GNU General Public License version 3
 * @author      Arfan Fudyartanto D N <arfan@mylits.com> - http://engine.mylits.com
 */

defined('MYLITS') ? '' : exit('No direct script access allowed');

$query['get_widgets_list'] = "
SELECT 
    a.core_widgets_id AS `id`, 
    a.core_widgets_name AS `name`,
    a.core_widgets_params AS `params`
FROM `#__core_widgets` a
LEFT JOIN `#__core_widgets_usermap` b ON (a.`core_widgets_id` = b.`core_widgets_usermap_widget_id`)
where a.`core_widgets_position` = '?' AND (a.`core_widgets_public` = 1 --filter--)";

$query['check_component_permission'] = "
SELECT 
  COUNT(*) AS `count`
FROM
  `#__core_components_group` a 
  JOIN `#__core_components` b 
    ON (
      a.core_components_group_component_id = b.`core_components_id`
    ) 
WHERE b.`core_components_name` = '?'";

$query['get_usergroup_list'] = "
SELECT 
    c.`core_usergroup_id` AS `group`
FROM `#__core_user` a
JOIN `#__core_usergroup_map` b ON (a.`core_user_id` = b.`core_usergroup_map_user_id`)
JOIN `#__core_usergroup` c ON (b.`core_usergroup_map_usergroup_id` = c.`core_usergroup_id`) 
WHERE b.`core_usergroup_map_user_id` = ?";

$query['get_real_path'] = "
SELECT 
    `core_menus_items_menu_path` AS `path`
FROM `#__core_menus_items` WHERE `core_menus_items_menu_path_alias` = '?'";

$query['get_active_template'] = "
SELECT 
    `core_templates_name`
FROM 
    `mylits_core_templates`
WHERE `core_templates_active` = 1
LIMIT 0, 1";
?>
